#include "home.h"
#include "ui_home.h"
#include<QLabel>

Home::Home(QWidget *parent) :
    QWidget(parent),
    ui(new Ui::Home)
{
    ui->setupUi(this);
    QPixmap pix("://Saved Pictures/xingnu.png");
    int scalHeight=ui->label->height();
    int scalWidth=pix.scaledToHeight(scalHeight).width();


    if(ui->label->width()<scalWidth)
    {
        scalWidth=ui->label->width();
        scalHeight=pix.scaledToWidth(scalWidth).height();
    }

    ui->label->setPixmap(pix.scaled(scalWidth,scalHeight,Qt::KeepAspectRatio));

}


Home::~Home()
{
    delete ui;
}

void Home::on_start_clicked()
{
    QMainWindow* w=new MainWindow();
    w->show();
    this->close();
}

void Home::on_exit_clicked()
{
    this->close();
}
